<template>
  <div>
    <el-card class="container">
      <!-- <div slot="header"> -->
      <!-- AddOrUpdate出现这CategorySelector要禁用 -->
      <CategorySelector :disabled="!isShowAttr" />
      <!-- </div> -->
    </el-card>
    <AttrList v-if="isShowAttr" @setShow="setShow" />
    <AddOrUpdate v-else @setShow="setShow" />
  </div>
</template>

<script>
import AddOrUpdate from "@/views/production/attr/AddOrUpdate";
import AttrList from "@/views/production/attr/AttrList";
export default {
  name: "Attr",
  data() {
    return {
      isShowAttr: true,
    };
  },
  methods: {
    // 通过自定义事件传递数据，不需要接收，只需要触发jike
    setShow(val) {
      this.isShowAttr = val;
    },
  },
  components: {
    AttrList,
    AddOrUpdate,
  },
};
</script>

<style>
</style>